#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main() {
    // 
    // Do not modify the code here
    char str[1001];

    // 
    // Write your code here
    scanf("%s", str);
    int left = 0;
    int sz = sizeof(str) / sizeof(str[0]);
    int temp = 0;
    int count = 0;
    while (left < sz)
    {
        if ((str[left] >= 'a' && str[left] <= 'z') || (str[left] >= 'A' && str[left] <= 'Z'))
        {
            temp = str[count];
            str[count] = str[left];
            str[left] = temp;
            count++;
        }
        else if ((str[left] < 'a' || str[left] > 'z') || (str[left] < 'A' || str[left] > 'Z'))
        {
            if (count > 0)
            {
                break;
            }
        }
        left++;
    }
    str[count] = '\0';
    // 
    // Do not modify the code here
    printf("%s\n", str);

    return 0;
}